package framework.webmvc.component;

import java.lang.reflect.Method;
import java.util.regex.Pattern;

/**
 * Store a handler's info including the class the method and the regex
 */
public class InchHandler {
    //store the class instance which the method are in
    private Object controller;
    //the method
    private Method method;
    //the regex to know if is this handler is called
    private Pattern pattern;



    /**
     * Constructor
     * @param controller the instance of the class of the method
     * @param method the method
     * @param pattern
     */
    public InchHandler(Object controller, Method method, Pattern pattern) {
        this.controller = controller;
        this.method = method;
        this.pattern = pattern;
    }

    public Object getController() {
        return controller;
    }

    public void setController(Object controller) {
        this.controller = controller;
    }

    public Method getMethod() {
        return method;
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    public Pattern getPattern() {
        return pattern;
    }

    public void setPattern(Pattern pattern) {
        this.pattern = pattern;
    }
}
